﻿using System;
using System.Collections.Generic;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Net;
using Microsoft.Xna.Framework.Storage;

namespace PoolGame2.Menus
{
    public class PauseMenu : Menu
    {
        public PauseMenu(PoolGame game)
            : base(game)
        {
            int height = 50;
            int menuspacing = 70;
            MenuItem item = new MenuItem("Return to Game", game);
            item.Position = new Vector2(40, height);
            item.onSelected = new EventHandler(resumeSelected);
            AddMenuItem(item);

            //height += (item.GetHeight() * 2);
            height += menuspacing;
            item = new MenuItem("Quit", game);
            item.Position = new Vector2(40, height);
            item.onSelected = new EventHandler(exitSelected);
            AddMenuItem(item);

            BGAlpha = 0.65f;
        }

        public void resumeSelected(object caller, EventArgs e)
        {
            PoolGame pgame = (PoolGame)Game;
            pgame.menuManager.SwitchMenu(MenuManager.eMenuTypes.MENU_NONE);
        }

        public void exitSelected(object caller, EventArgs e)
        {
            PoolGame pgame = (PoolGame)Game;
            pgame.EndGame();
        }
    }
}
